<?php

use think\facade\Route;
//echo 123;

Route::group('login',function (){
   Route::post('login','Login/login');
   Route::post('sms','Login/Sms');
   Route::post('register','Login/register');
   Route::post('forgot','Login/forgot');
   Route::post('upload','Upload/upload');
})->allowCrossDomain([
    'Access-Control-Allow-Origin'        => '*',
//    'Access-Control-Allow-Credentials'   => 'true'
    'Access-Control-Allow-Methods' => '*',
    'Access-Control-Allow-Headers' => '*'
]);
//更多服务
Route::group('More',function (){
   Route::get('index','More/index');
   Route::post('list','Serve/index');
})->middleware(\app\appa\middleware\CheckToken::class)
    ->allowCrossDomain([
        'Access-Control-Allow-Origin'        => '*',
//    'Access-Control-Allow-Credentials'   => 'true'
        'Access-Control-Allow-Methods' => '*',
        'Access-Control-Allow-Headers' => '*'
    ]);
//宠物
Route::group('pet',function (){
   Route::post('index','Pet/index');
   Route::post('list','Pet/list');
   Route::post('add','Pet/add');
   Route::post('edit','Pet/edit');
   Route::post('update','Pet/update');
   Route::post('delete','Pet/delete');
})->middleware(\app\appa\middleware\CheckToken::class)
    ->allowCrossDomain([
        'Access-Control-Allow-Origin'        => '*',
//    'Access-Control-Allow-Credentials'   => 'true'
        'Access-Control-Allow-Methods' => '*',
        'Access-Control-Allow-Headers' => '*'
    ]);

//地址
Route::group('address',function (){
   Route::get('index','Address/index');
   Route::post('add','Address/add');
   Route::get('edit','Address/edit');
   Route::post('update','Address/update');
   Route::get('delete','Address/delete');
   Route::post('switch','Address/switch');
})->middleware(\app\appa\middleware\CheckToken::class)
    ->allowCrossDomain([
        'Access-Control-Allow-Origin'        => '*',
//    'Access-Control-Allow-Credentials'   => 'true'
        'Access-Control-Allow-Methods' => '*',
        'Access-Control-Allow-Headers' => '*'
    ]);

//师傅
Route::group('master',function (){
    //综合
    Route::get('list1','Master/list1');
    //距离
    Route::get('list2','Master/list2');
    //服务次数
    Route::get('list3','Master/list3');
    //好评
    Route::get('list4','Master/list4');
    //师傅详情
    Route::post('index','Master/index');
    //查看全部评价
    Route::post('index2','Master/index2');

})->middleware(\app\appa\middleware\CheckToken::class)
    ->allowCrossDomain([
        'Access-Control-Allow-Origin'        => '*',
//    'Access-Control-Allow-Credentials'   => 'true'
        'Access-Control-Allow-Methods' => '*',
        'Access-Control-Allow-Headers' => '*'
    ]);

//评价
Route::group('apa',function (){
    //发布评论
    Route::post('add','Apa/add');
    //按照好评查看评论
    Route::post('index1','Apa/index1');
    //按照中评查看评论
    Route::post('index2','Apa/index2');
    //按照差评查看评论
    Route::post('index3','Apa/index3');
})->middleware(\app\appa\middleware\CheckToken::class)
    ->allowCrossDomain([
        'Access-Control-Allow-Origin'        => '*',
//    'Access-Control-Allow-Credentials'   => 'true'
        'Access-Control-Allow-Methods' => '*',
        'Access-Control-Allow-Headers' => '*'
    ]);

//订单
Route::group('Order',function (){
    //查看全部订单
    Route::get('index','Order/index');
    //查看全部订单的待支付
    Route::get('index1','Order/index1');
    //查看全部订单的待接单
    Route::get('index2','Order/index2');
    //查看全部订单的已接单
    Route::get('index3','Order/index3');
    //查看全部订单的服务中
    Route::get('index4','Order/index4');
    //查看全部订单的已完成
    Route::get('index5','Order/index5');
    //订单中心
    Route::post('list','Order/list');
    //待服务
    Route::post('list1','Order/list1');
    //服务中
    Route::post('list2','Order/list2');
    //已完成
    Route::post('list3','Order/list3');
    //添加订单
    Route::post('add','Order/add');
    //师傅接单
    Route::post('add2','Order/add2');
    //确认支付
    Route::post('pay','Order/pay');
    //服务中
    Route::post('edit1','Order/edit1');
    //已完成服务
    Route::post('edit2','Order/edit2');
    //查看订单详情
    Route::post('detail','Order/detail');
})->middleware(\app\appa\middleware\CheckToken::class)
    ->allowCrossDomain([
        'Access-Control-Allow-Origin'        => '*',
//    'Access-Control-Allow-Credentials'   => 'true'
        'Access-Control-Allow-Methods' => '*',
        'Access-Control-Allow-Headers' => '*'
    ]);


//专属客服
Route::group('cs',function (){
    Route::get('index','Cs/index');
})->middleware(\app\appa\middleware\CheckToken::class)
    ->allowCrossDomain([
        'Access-Control-Allow-Origin'        => '*',
//    'Access-Control-Allow-Credentials'   => 'true'
        'Access-Control-Allow-Methods' => '*',
        'Access-Control-Allow-Headers' => '*'
    ]);
